import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '处理人',
    align: "center",
    dataIndex: 'processor_dictText'
  },
  {
    title: '操作',
    align: "center",
    dataIndex: 'controls'
  },
  {
    title: '处理结果',
    align: "center",
    dataIndex: 'processingResult'
  },
  {
    title: '处理意见',
    align: "center",
    dataIndex: 'handlingSuggestion'
  },
  {
    title: '操作时间',
    align: "center",
    dataIndex: 'operatingTime'
  },
];

//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    label: "处理人",
    field: 'processor',
    component: 'JSelectUserByDept',
    //colProps: {span: 6},
  },
  {
    label: "操作",
    field: 'controls',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "操作时间",
    field: "operatingTime",
    component: 'RangePicker',
    componentProps: {
      showTime: true,
    },
    //colProps: {span: 6},
  },
];

//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '处理人',
    field: 'processor',
    component: 'JSelectUserByDept',
    componentProps:{
      labelKey: 'realname',
    },
  },
  {
    label: '操作',
    field: 'controls',
    component: 'Input',
  },
  {
    label: '处理结果',
    field: 'processingResult',
    component: 'Input',
  },
  {
    label: '处理意见',
    field: 'handlingSuggestion',
    component: 'Input',
  },
  {
    label: '操作时间',
    field: 'operatingTime',
    component: 'DatePicker',
    componentProps: {
      showTime: true,
      valueFormat: 'YYYY-MM-DD HH:mm:ss'
    },
  },
	// TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
];

// 高级查询数据
export const superQuerySchema = {
  processor: {title: '处理人',order: 0,view: 'sel_user', type: 'string',},
  controls: {title: '操作',order: 1,view: 'text', type: 'string',},
  processingResult: {title: '处理结果',order: 2,view: 'text', type: 'string',},
  handlingSuggestion: {title: '处理意见',order: 3,view: 'text', type: 'string',},
  operatingTime: {title: '操作时间',order: 4,view: 'datetime', type: 'string',},
};
